package com.outdoor.server.controller.user;

import com.outdoor.common.result.Result;
import com.outdoor.pojo.dto.TracePublishDTO;
import com.outdoor.pojo.entity.Trace;
import com.outdoor.server.service.TraceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("userTraceController")
@RequestMapping("/user/trace")
@Slf4j
public class TraceController {

    @Autowired
    private TraceService traceService;

    /**
     * 发布路线
     * @param tracePublishDTO
     * @return
     */
    @PostMapping("/publish")
    public Result publishTrace(@RequestBody TracePublishDTO tracePublishDTO) {
        log.info("发布路线：{}", tracePublishDTO);
        traceService.publishTrace(tracePublishDTO);
        return Result.success();
    }
} 